<?php
/**
 * Created by PhpStorm.
 * User: fangwei
 * Date: 2019-06-26
 * Time: 22:40
 */

namespace App\Http\Requests\Admin;


use Illuminate\Foundation\Http\FormRequest;

class UserRoleInputDTO extends FormRequest
{
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        return [
            'role' => 'required|array',
            'role.*' => 'integer',
        ];
    }

    public function messages()
    {
        return [
            'role.required' => '必须选择角色',
            'role.array' => '角色参数错误',
            'role.*.integer' => '角色参数错误',
        ];
    }
}